% ���Ƶ���ģ�ͺ���в
function PlotModel(model)

surf(model.X,model.Y,model.H); % ���Ƶ���
colormap summer;                    % ���Ƶ�����ɫ
shading flat
material dull;                   % ������ɫ
camlight left;                   % ����ߵĴ��
lighting gouraud;                % �ƹ�
xlabel('x [m]');ylabel('y [m]');zlabel('z [m]');
hold on

% Բ�����ϰ�
threats = model.threats;
threat_num = size(threats,1);
h=250; % �߶�

for i = 1:threat_num
    threat = threats(i,:);
    threat_x = threat(1);
    threat_y = threat(2);
    threat_z = threat(3);
    threat_radius = threat(4);
    [xc,yc,zc]=cylinder(threat_radius); % ��λԲ��
    color_mat=[186,10,84]./255; %�����ɫ
    % �������ĺ͸߶�
    xc=xc+threat_x;
    yc=yc+threat_y;
    zc=zc*h+threat_z;
    c = surf(xc,yc,zc); % Բ����
    
    fill3(xc(1,:),yc(1,:),zc(1,:),color_mat,'edgecolor','none');
    fill3(xc(2,:),yc(2,:),zc(2,:),color_mat,'edgecolor','none');       
    set(c,'edgecolor','none','facecolor',color_mat,'FaceAlpha',.3); %������ɫ    
end

end